package com.ldq.imooc.basics.io;

import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @Author : 李道泉
 * @Description :
 * @Date : 2018/4/17 9:36
 * @Modified by :
 */
public class FileOutDemo1 {

    public static void main(String[] args) throws IOException {

        FileOutputStream out = new FileOutputStream("demo/out.dat");
        out.write('A');//写出'A'的低八位，write只能写八位
        int a = 10;//一个int 需要写四次
        out.write(a>>>24);
        out.write(a>>>16);
        out.write(a>>>8);
        out.write(a);

        byte[] gbk = "中国".getBytes("gbk");
        out.write(gbk);
        out.close();

        IOUtil.printHex("demo/out.dat");
    }
}
